package locations.actions;

import java.util.ArrayList;
import java.util.List;

import locations.dao.DAOFactory;
import locations.dao.InstitutionDAO;
import locations.model.Institution;

import com.opensymphony.xwork2.ActionSupport;


public class InstitutionIndexAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String pageTitle = "Listado de Pacientes";
	private List<Institution> institutions = new ArrayList<Institution>();
	
	public String execute() throws Exception {
		InstitutionDAO dao = DAOFactory.getInstitutionDAO();
		this.setInstitutions(dao.retrieveAll());
		return SUCCESS;
	}

	public String getPageTitle() {
		return pageTitle;
	}

	public void setPageTitle(String pageTitle) {
		this.pageTitle = pageTitle;
	}

	public List<Institution> getInstitution() {
		return institutions;
	}

	public void setInstitutions(List<Institution> institutions) {
		this.institutions = institutions;
	}
	
	
	
	
}
